# device_config = {
#     "wubiao": {
#         "username": "681d9ef69314d118511a03be_mqtt_test",
#         "password": "8146e8b4dc3310fcc8ef8ec4a354666b94ace74de1bcff0baba20aff7b792fff",
#         "client_id": "681d9ef69314d118511a03be_mqtt_test_0_0_2025050906",
#         "hostname": "6adfd9c87f.st1.iotda-device.cn-north-4.myhuaweicloud.com",
#         "port": 1883,
#         "protocol": "MQTT"},
#
#     "jun": {
#         "username": "mqtt_jun_test",
#         "password": "a75fb62f148c5e1e7d10d54c87d67a8c66acebb472339c49c71140c6f3a1c64a",
#         "client_id": "mqtt_jun_test_0_0_2025051113",
#         "hostname": "1ebc38d7eb.st1.iotda-device.cn-north-4.myhuaweicloud.com",
#         "port": 1883,
#         "protocol": "mqtt"
#     },
#     "tang": {
# }
HUAWEI_IOT_CONFIG = {
    'IAM_URL': 'https://iam.cn-south-4.myhuaweicloud.com/v3/auth/tokens',
    'IOT_URL': 'https://c5291326ae.iotda-app.cn-south-4.myhuaweicloud.com/v5/iot/9a8b9ae393844bce8de80dbc4ed08df2',
    'DEVICE_ID': 'my_central',
    'USERNAME': 'jun',
    'PASSWORD': 'junjjxiaoxiaode6cm!',
    'DOMAIN': 'hid_5qb4jhtria1zq1j',
    'PROJECT': 'cn-south-4',
    'SERVICE_ID': 'Switch',
    'COMMAND_NAME': 'control'
}

device_config = {
    "username": "central_websoc",
    "password": "9cde2d22e5ccb26910c498c738e2015f445e9ff24359257adaca76fd37e709c3",
    "client_id": "central_websoc_0_0_2025051513",
    "hostname": "c5291326ae.iotda-device.cn-south-4.myhuaweicloud.com",
    "port": 1883,
    "protocol": "MQTTS"
}

# 设备属性数据
device_properties = {
    "services": [
        {
            "service_id": "mqtt",
            "properties": {
                "tem": 25.5,  # 温度
                "hum": 60.5,  # 湿度
                "led": True,  # LED状态
                "stat": True  # 设备状态
            },
            "event_time": None
        }
    ]
}

# 标志变量，用于跟踪LED状态变化的来源
is_local_led_change = False

# MQTT客户端
shadow_query_interval = None
log_messages = []
